home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Development Tools & Languages / Dylan Related / Mindy / Mindy 1.2 - Mac PPC / doc / random.doc < prev    next >
Encoding:
Text File  |  1995-03-15  |  2.1 KB  |  48 lines  |  [TEXT/MMCC]

  1.  
  2. The Random Library
  3.  
  4. The Random Numbers library exports a single module, Random.  This module
  5. exports an interface to various classes, each representing a random
  6. distribution.
  7.  
  8. <random-distribution>                    [Abstract Class]
  9. <uniform-distribution>                    [Abstract Class]
  10. <unit-uniform-distribution>                    [Class]
  11. <real-uniform-distribution>                    [Class]
  12. <integer-uniform-distribution>                    [Class]
  13. <exponential-distribution>                    [Class]
  14. <normal-distribution>                        [Class]
  15.    These classes are the random distributions defined in the library.  The
  16.    abstract classes <random-distribution> and <uniform-distribution> are not
  17.    instantiable.  The make method for the instantiable classes accepts the
  18.    keyword seed:, used to seed the distribution.  The seed must be a
  19.    positive integer.
  20.  
  21. random (distribution :: <random-distribution>)        [Generic Function]
  22.    This function returns a random number from distribution.
  23.    Each of the instantiable classes above has a method for random.
  24.  
  25. *dylan-random-seed*                    [Variable]
  26. *dylan-random-distribution*                [Variable]
  27. random-uniform (#key from, to)                [Constant Method]
  28. seed-random! (integer)                    [Constant Method]
  29.    These variables and functions are provided so that programmers will not
  30.    have to create their own random distributions just to get simple random
  31.    numbers.
  32.  
  33.    The variable *dylan-random-seed* contains the default seed for all
  34.    <random-distribution>s.  (A different seed can be given through the
  35.    seed: keyword argument.)  The variable *dylan-random-distribution*
  36.    contains a global unit uniform distribution.
  37.  
  38.    The function random-uniform returns a random number from a uniform
  39.    distribution.  The bounds of the uniform distribution are given by
  40.    keywords from: and to: (which default to 0.0d0 and 1.0d0).  The type of
  41.    the number returned is same as the types of the keyword arguments (whose
  42.    types must be identical).  The function uses *dylan-random-distribution*
  43.    to generate this number.
  44.  
  45.    The function seed-random! sets *dylan-random-seed* to integer (which
  46.    must be positive) and sets *dylan-random-distribution* to a new unit
  47.    uniform seeded to integer.
  48.